<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <title>JSP - Hello World</title>
</head>
<body>
<%
    response.setCharacterEncoding("utf-8");
    String username ="root";
    String pwd ="123123";
    String url="jdbc:mysql://localhost:3306/tb?serverTimezone=Asia/Shanghai";
    Class.forName("com.mysql.cj.jdbc.Driver");
    Connection conn= DriverManager.getConnection(url,username,pwd);
    java.sql.Statement statement = conn.createStatement();
    String sql= "select * from newtable";
    ResultSet resultSet= statement.executeQuery(sql);
    System.out.println(resultSet);
    while (resultSet.next()){
        String number= resultSet.getString("number");
        String name= resultSet.getString("name");
        String birthdy =resultSet.getString("birthday");
        String stuclss =resultSet.getString("classname");
        System.out.println(number);
        System.out.println(birthdy);
        System.out.println(stuclss);
        System.out.println(name);
    }
%>
<form action="web.jsp（1）" method="post">
    <input type="text" name="number">
    <input type="text" name="name">
    <input type="text" name="birthdy">
    <input type="text" name="stuclass">
    <input type="submit" value="增">
</form>
<form method="post" action="first（1）.jsp">
    <input type="text" name="查">
    <input type="submit" value="查">
</form>
<form method="post" action="delte（1）.jsp">
    <input type="text" name="删">
    <input type="submit" value="删">
</form>
<form action="gai（1）.jsp" method="post">
    <input type="text" name="number">
    <input type="text" name="birthdy">
    <input type="text" name="stuclass">
    <input type="submit" value="改">
</form>
</body>
</html>